﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using Logistics_Service.DTO;
using Logistics_Service.DAO;

namespace Logistics_Service
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface ILogisticsService
    {

        [OperationContract]
        [WebGet(UriTemplate = "loginKH/{username}/{pass}",ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        KhachHangDTO LoginKH(string username, string pass);

        [OperationContract]
        [WebGet(UriTemplate = "khachhang", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        KhachHangDTO[] DanhSachKhachHang();

        [OperationContract]
        [WebInvoke(UriTemplate = "themkhachhang/{ten}/{user}/{matkhau}/{cmnd}/{sdt}/{email}/{ngaysinh}/{diachi}", Method = "GET",  RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        bool ThemKhachHang(string ten, string user, string matkhau, string cmnd, string sdt, string email, string ngaysinh, string diachi);

        [OperationContract]
        [WebInvoke(UriTemplate = "xoakhachhang/{ma}", Method = "GET")]
        bool XoaKhachHang(string ma);

        [OperationContract]
        [WebInvoke(UriTemplate = "capnhatkhachhang/{ma}/{ten}/{user}/{matkhau}/{cmnd}/{sdt}/{email}/{ngaydangky}/{xacnhan}/{ngaysinh}/{diachi}", Method = "GET", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        bool CapNhatKhachHang(string ma, string ten, string user, string matkhau, string cmnd, string sdt, string email, string ngaydangky,string xacnhan, string ngaysinh, string diachi);

        [OperationContract]
        [WebGet(UriTemplate = "dsloaivanchuyen", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        LoaiVanChuyenDTO[] DanhSachLoaiVanChuyen();
        //-------------Tuyen Duong--------------
        [OperationContract]
        [WebGet(UriTemplate = "dsxe", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        XeDTO[] DanhSachXe();

        [OperationContract]
        [WebGet(UriTemplate = "dschucvu", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        ChucVuDTO[] DanhSachChucVu();

        [OperationContract]
        [WebGet(UriTemplate = "dsloainhanvien", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        LoaiNhanVienDTO[] DanhSachLoaiNhanVien();

        [OperationContract]
        [WebGet(UriTemplate = "dsnhanvien", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        NhanVienDTO[] DanhSachNhanVien();

        [OperationContract] 
        [WebGet(UriTemplate = "dstuyenduong", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        TuyenDuongDTO[] DanhSachTuyenDuong();


        //----------Chi Nhánh -------------
        [OperationContract]
        [WebGet(UriTemplate = "dschinhanh", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        ChiNhanhDTO[] DanhSachChiNhanh();

        [OperationContract]
        [WebInvoke(UriTemplate = "themchinhanh/{ten}/{diachi}/{sdt}/{matinhthanh}", Method = "GET", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        bool ThemChiNhanh(string ten, string diachi, string sdt, string matinhthanh);


        [OperationContract]
        [WebGet(UriTemplate = "dstinhthanh", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        TinhThanhDTO[] DanhSachTinhThanh();

        [OperationContract]
        [WebGet(UriTemplate = "timsokm/{dd}/{dc}", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        float TimSoKm(string dd,string dc);

        //-------------Dia Diem-----------------
        [OperationContract]
        [WebGet(UriTemplate = "dsdiadiem", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        DiaDiemDTO[] DanhSachDiaDiem();

        [OperationContract]
        [WebGet(UriTemplate = "dslichvanchuyen", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        LichVanChuyenDTO[] DanhSachLichVanChuyen();

        [OperationContract]
        [WebGet(UriTemplate = "dsgoihang/{makhachhang}", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        GoiHangDTO[] DanhSachGoiHang(string makhachhang);

        [OperationContract]
        [WebGet(UriTemplate = "chitietgoihang/{magoihang}", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        GoiHangDTO GoiHang(string magoihang);

        [OperationContract]
        [WebInvoke(UriTemplate = "capnhatgoihang/{magoihang}/{vitrikho}", Method = "GET", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        bool CapNhatGoiHang(string magoihang,string vitrikho);
        //------------DonHang-------------
        [OperationContract]
        [WebInvoke(UriTemplate="themdonhang/{ngaydat}/{ngaylay}/{dcLay}/{maloaivc}/{tenNN}/{cmnd}/{sdt}/{dcNN}/{magh}/{makh}/{tenchuthe}/{sotk}/{tongtien}",Method="GET",BodyStyle=WebMessageBodyStyle.Bare,ResponseFormat=WebMessageFormat.Json)]
        bool ThemDonHang(string ngaydat,string ngaylay, string dcLay, string maloaivc, string tenNN, string cmnd, string sdt, string dcNN, string magh, string makh, string tenchuthe, string sotk, string tongtien);

        [OperationContract]
        [WebGet(UriTemplate = "donhang/{makh}", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        DSDonHangDTO[] DanhSachDonHangTheoKhachHang(string makh);

        [OperationContract]
        [WebGet(UriTemplate = "donhangchuathuchien/{makh}", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        DSDonHangDTO[] DanhSachDonHangTheoKhachHangChuaThucHien(string makh);

        [OperationContract]
        [WebGet(UriTemplate = "chitietdonhang/{madonhang}", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        DSDonHangDTO[] ChiTietDonHang(string madonhang);
        //---------BangGia---------------
        [OperationContract]
        [WebGet(UriTemplate = "banggia/{sokm}", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        BangGiaDTO[] GiaTheoKm(string sokm);
    }


    // Use a data contract as illustrated in the sample below to add composite types to service operations.
    //[DataContract]
    //public class CompositeType
    //{
    //    bool boolValue = true;
    //    string stringValue = "Hello ";

    //    [DataMember]
    //    public bool BoolValue
    //    {
    //        get { return boolValue; }
    //        set { boolValue = value; }
    //    }

    //    [DataMember]
    //    public string StringValue
    //    {
    //        get { return stringValue; }
    //        set { stringValue = value; }
    //    }
    //}
}
